#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
using namespace std;

void practice_first_letter()
{
	string s;
	cin >> s;
	string key;
	cin >> key;
	string tmp = "";

	tmp += s[0];
	for (size_t i = 0; i < s.size(); i++)
	{
		while (i != s.size() && s[i] != '_')
		{
			i++;
		}
		if (i == s.size())
			break;
		i++;
		tmp += s[i];
	}
	if (tmp == key)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

}
string add(string n1, string n2)
{
	string t = "";
	/*reverse(n1.begin(), n1.end());
	reverse(n2.begin(), n2.end());*/
	string max = n1;
	string min = n2;
	if (max.size() < min.size())
	{
		max = n2;
		min = n1;
	}
	int x = 0, y = 0, sum = 0, ret = 0;
	for (int i = 0; i < max.size(); i++)
	{
		x = max[i] - '0';
		if (i < min.size())
			y = min[i] - '0';
		else
			y = 0;
		sum = x + y + ret;
		ret = sum / 10;
		sum %= 10;
		t += (sum + '0');
	}
	if (ret)
		t += (ret + '0');
	/*reverse(t.begin(), t.end());*/
	return t;
}
bool compare_small(string s1, string s2)
{
	if (s1.size() < s2.size())
		return true;
	else
	{
		return s1 < s2;
	}
}
//string multiply(string s1, string s2)
//{
//	string i = "0";
//	string end = s2;
//	string add_one = "1";
//	string tmp = "0";
//	for (; compare_small(i,end); i=add(i,add_one))
//	{
//		tmp = add(tmp, s1);
//	}
//	return tmp;
//}
#define num 3
//string multiply(string num1, string num2) {
//    string t = "";
//    reverse(num1.begin(), num1.end());
//    reverse(num2.begin(), num2.end());
//    string max = num1;
//    string min = num2;
//    if (max.size() < min.size()) {
//        max = num2;
//        min = num1;
//    }
//    string tmp[num];
//    /*for (int i = 0; i < min.size(); i++) {
//        tmp[i] = "";
//    }*/
//    int result = 0, f1 = 0, f2 = 0;
//    for (int i = 0; i < min.size(); i++) {
//        int x = min[i] - '0';
//        for (int j = 0; j < i; j++) {
//            tmp[i] += '0';
//        }
//        for (int j = 0; j < max.size(); j++) {
//            int y = max[j] - '0';
//            result = x * y + f2;
//            f2 = result / 10;
//            f1 = result % 10;
//            tmp[i] += (f1 + '0');
//        }
//        if (f2)
//            tmp[i] += (f2 + '0');
//        f2 = 0;
//        t = add(t, tmp[i]);
//    }
//    reverse(t.begin(), t.end());
//    return t;
//}
string multiply(string num1, string num2) {
	int n1 = num1.size(), n2 = num2.size();
	vector<int> vi(n1 + n2, 0);

	for (int i = n1 - 1; i >= 0; i--)
	{
		for (int j = n2 - 1; j >= 0; j--)
		{
			int ret = (num1[i] - '0') * (num2[j] - '0');
			vi[i + j + 1] += ret;
		}
	}

	int ret = 0, flag = 0;
	for (int i = n1 + n2 - 1; i >= 0; i--)
	{
		vi[i] += flag;
		flag = vi[i] / 10;
		vi[i] %= 10;
	}

	int i = vi[0] == 0 ? 1 : 0;
	bool f = vi[i] == 0 ? false : true;
	string ans = "";
	for (; i < n1 + n2; i++)
	{
		if (f == true || vi[i] != 0)
		{
			ans += vi[i] + '0';
			f = true;
		}
	}
	if (!f)
		return "0";
	else
		return ans;
}
int main()
{
	/*string s = "";
	s += 48;
	cout << s;*/
	string s1 = "456";
	string s2 = "123";
	//string tmp[5] = {"","","","",""};
	//string tmp = add(s1, s2);
	//cout << tmp << endl;
	/*if (s1 > s2)
		cout << "Yes" << endl;*/
	cout << multiply(s1, s2);

	return 0;
}
